﻿namespace GuiMailAmazon
{
    using DevComponents.DotNetBar;
    using DevComponents.DotNetBar.Controls;
    using DevComponents.DotNetBar.Metro;
    using DevComponents.DotNetBar.Metro.ColorTables;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class testSendMail : MetroForm
    {
        private ButtonX btnSend;
        private IContainer components = null;
        private LabelX labelX1;
        private string strContent;
        private string strSubject;
        private StyleManager styleManager1;
        private TextBoxX txtMailTo;

        public testSendMail(string _strSubject, string _strContent)
        {
            this.strSubject = _strSubject;
            this.strContent = _strContent;
            this.InitializeComponent();
        }

        private void btnSend_Click(object sender, EventArgs e)
        {
            if (clsEmail.sendMailOK(this.txtMailTo.Text, this.strSubject, this.strContent))
            {
                MessageBox.Show("Send mail Succsessfully");
            }
            else
            {
                MessageBox.Show("Send mail Error");
                this.txtMailTo.Focus();
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(testSendMail));
            this.styleManager1 = new DevComponents.DotNetBar.StyleManager(this.components);
            this.labelX1 = new DevComponents.DotNetBar.LabelX();
            this.txtMailTo = new DevComponents.DotNetBar.Controls.TextBoxX();
            this.btnSend = new DevComponents.DotNetBar.ButtonX();
            this.SuspendLayout();
            // 
            // styleManager1
            // 
            this.styleManager1.ManagerStyle = DevComponents.DotNetBar.eStyle.Metro;
            this.styleManager1.MetroColorParameters = new DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters(System.Drawing.Color.White, System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(163)))), ((int)(((byte)(26))))));
            // 
            // labelX1
            // 
            // 
            // 
            // 
            this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.labelX1.Location = new System.Drawing.Point(12, 12);
            this.labelX1.Name = "labelX1";
            this.labelX1.Size = new System.Drawing.Size(30, 23);
            this.labelX1.TabIndex = 0;
            this.labelX1.Text = "To: ";
            // 
            // txtMailTo
            // 
            this.txtMailTo.BackColor = System.Drawing.Color.White;
            // 
            // 
            // 
            this.txtMailTo.Border.Class = "TextBoxBorder";
            this.txtMailTo.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.txtMailTo.ForeColor = System.Drawing.Color.Black;
            this.txtMailTo.Location = new System.Drawing.Point(48, 15);
            this.txtMailTo.Name = "txtMailTo";
            this.txtMailTo.Size = new System.Drawing.Size(233, 22);
            this.txtMailTo.TabIndex = 1;
            // 
            // btnSend
            // 
            this.btnSend.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnSend.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnSend.Location = new System.Drawing.Point(287, 15);
            this.btnSend.Name = "btnSend";
            this.btnSend.Size = new System.Drawing.Size(75, 23);
            this.btnSend.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnSend.TabIndex = 2;
            this.btnSend.Text = "Send";
            this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
            // 
            // testSendMail
            // 
            this.ClientSize = new System.Drawing.Size(367, 46);
            this.Controls.Add(this.btnSend);
            this.Controls.Add(this.txtMailTo);
            this.Controls.Add(this.labelX1);
            this.DoubleBuffered = true;
            this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximumSize = new System.Drawing.Size(383, 85);
            this.MinimumSize = new System.Drawing.Size(383, 85);
            this.Name = "testSendMail";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Test Send Mail";
            this.ResumeLayout(false);

        }
    }
}

